{include file=header.html}
<script language="javascript" type="text/javascript" src="{res file=js/jquery-1.2.6.js}"></script>
<script language="javascript" type="text/javascript" src="{lib file=jquery.plugins/jquery.validate.js}"></script>
<script type="text/javascript">
$(function(){
    $('#guestbookform').validate({
		onkeyup : false,
		onfocusout : false,
		rules : {
			gb_title: {
				required: true
			},
			guestbook_content: {
				required: true
			}{if $smarty.get.act neq 'add'},
			reply_content: {
				required: true
			}
			{/if}
		},
		messages : {
			gb_title: {
				required: '{$lang.gbtitle_required}'
			},
			guestbook_content: {
				required: '{$lang.guestcontent_required}'
			}{if $smarty.get.act neq 'add'},
			reply_content: {
				required: '{$lang.replycontent_required}'
			}
			{/if}
		}
	 });
});
</script>
<style type="text/css">
label.error {margin-left:2em; color:#FF0000;}
input {
	vertical-align: -5px;_vertical-align: -1px;margin-right: 5px
}
</style>
<body>
<div class="sub-body">
<div class="tab-frame" style="width:700px;">
<div class="tab-title-1">
<!--{if $smarty.get.act eq 'add'}--><span>{$lang.add_guestbook}</span><!--{else}--><span>{$lang.edit_guestbook}</span><!--{/if}-->
</div>
<form action="" id="guestbookform" method="post">
<table width="100%" cellspacing="0" cellpadding="0" class="tab-display">
	<tr>
		<th width="15%" align="right">{$lang.gb_title}：</th>
		<td align="left">{if $smarty.get.act neq 'add'}{$books.gb_title}{else}<input type="text" id="gb_title" name="gb_title" value="{$books.gb_title}" style="width:100%;" class="input-3" />{/if}</td>
	</tr>
	<!-- {if $smarty.get.act eq 'add'} -->
	<tr>
		<th align="right">{$lang.guestbook_content}：</th>
		<td align="left">
			<textarea id="guestbook_content" name="guestbook_content" style="width:600px; height:300px;">{$books.guestbook_content}</textarea>
		</td>
	</tr>
	<!-- {else} -->
	<tr>
		<th align="right">{$lang.guestbook_content}：</th>
		<td align="left">
			<div style="width:600px; height:300px;">{$books.guestbook_content}</div>
		</td>
	</tr>
	<tr>
		<th align="right">{$lang.reply_content}：</th>
		<td align="left">
			<textarea id="reply_content" name="reply_content" style="width:600px; height:300px;">{$books.reply_content}</textarea>
		</td>
	</tr>
	<!-- {/if} -->
	<tr>
		<td colspan="2" align="center"><input type="submit" value="{$lang.submit}" class="btn-2"/></td>
	</tr>
</table>
</form>
</div>
</div>
</body>
</html>